package task01;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class StudentManagementTest {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 登陆系统
        // 密码：123456
        System.out.println("请先输入系统密码：");

        StudentManagementSystem system = new StudentManagementSystem();
        if (system.login(scanner.nextLine())){
            system.printALl();
            System.out.println("----------------------");

            // 创建学生对象
            List<Student> students = new ArrayList<>();
            try {
                students.add(new Student("001","1号","男",20,100));
                students.add(new Student("002","2号","女",21,98));
                students.add(new Student("003","3号","c",22,101));
                students.add(new Student("004","4号","男",-23,100));
            } catch (AgeException e) {
                e.printStackTrace();
            } catch (GenderException e) {
                e.printStackTrace();
            } catch (GradeException e) {
                e.printStackTrace();
            }

            // 添加学生
            for(Student s : students){
                system.addStudent(s);
            }
            // 打印所有学生
            system.printALl();
            // 删除学生
            System.out.println("请输入删除学号");
            system.deleteStudent(scanner.nextLine());
            // 打印所有学生
            system.printALl();

            system.logout();

        }
    }
}
